<?php /*a:2:{s:69:"D:\laragon\www\uavshop\application\manage\view\admin_menus_index.html";i:1540951044;s:56:"D:\laragon\www\uavshop\application\manage\view\base.html";i:1596192950;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1">
	<meta name="renderer" content="webkit">
<title>后台管理系统</title>
<link rel="stylesheet" href="/static/public/awesome/css/font-awesome.min.css" />

<link rel="stylesheet" href="/static/public/layui/css/layui.css" />

<link rel="stylesheet" href="/static/public/kindeditor/themes/default/default.css" />
<link rel="stylesheet" href="/static/manage/css/style.css" />

	<link rel="stylesheet" href="/static/public/dist/zoomify.min.css">
	
<script src="/static/public/kindeditor/kindeditor-all.js"></script>
<script src="/static/public/kindeditor/lang/zh_CN.js"></script>
<script src="/static/public/ueditor/ueditor.config.js?t=<?php echo time();?>"></script>
<script src="/static/public/ueditor/ueditor.all.min.js"></script>
<script src="/static/public/ueditor/lang/zh-cn/zh-cn.js"></script>
</head>
<body>
<?php if($is_auth): ?>

<div class="g-main">
    <div class="m-main-title">
        <div class="m-container-fluid">
            <a href="<?php echo url('index/welcome'); ?>"><i class="icon icon-home"></i>首页</a>
            <span class="icon-angle-right"></span>
            <span>系统</span>
            <span class="icon-angle-right"></span>
            <span>系统设置</span>
            <span class="icon-angle-right"></span>
            <span>后台菜单管理首页</span>
            <a class="u-flush"><i class="icon-repeat"></i></a>
        </div>
    </div>
    <div class="m-main-content">
        <div class="m-container">
            <table class="m-table">
                <tr>
                    <th>
                        <div class="m-options cf">
                            <div class="m-opts fl"><a href="<?php echo url('add'); ?>" class="u-btn"><i class="icon-plus"></i>添加菜单</a></div>
                        </div>
                    </th>
                </tr>
            </table>
            <form class="layui-form m-list-form">
                <table class="m-table mt-10">
                    <tbody class="datas">
                        <tr>
                            <th width="8%">排序</th>
                            <th width="5%">ID</th>
                            <th width="17%">名称</th>
                            <th width="20%">icon 图标</th>
                            <th width="30%">链接</th>
                            <th width="10%">状态</th>
                            <th width="10%">操作</th>
                        </tr>
                        <?php if(is_array($menus) || $menus instanceof \think\Collection || $menus instanceof \think\Paginator): if( count($menus)==0 ) : echo "" ;else: foreach($menus as $key=>$menu): ?>
                        <tr class="m-menu m-menu-<?php echo htmlentities($menu['parent_id']); ?>"<?php if($menu['level'] > 1): ?> style="display: none;"<?php endif; ?>>
                            <td><?php echo $menu['html']; ?><a href="javascript:;" class="u-caret-right" data-id="<?php echo htmlentities($menu['id']); ?>" data-sub-ids="<?php echo htmlentities($menu['sub_ids']); ?>"><i class="icon-caret-right"></i></a><input type="text" name="list_order[<?php echo htmlentities($menu['id']); ?>]" lay-skin="primary" class="u-ipt u-ipt-tiny" value="<?php echo htmlentities($menu['list_order']); ?>" /></td>
                            <td><?php echo htmlentities($menu['id']); ?></td>
                            <td><?php echo htmlentities($menu['name']); ?></td>
                            <td><?php echo htmlentities($menu['icon']); ?></td>
                            <td><?php echo htmlentities($menu['url']); ?></td>
                            <td><span class="u-status<?php echo !empty($menu['status']) ? ' u-status-danger'  :  ' u-status-primary'; ?>" data-id="<?php echo htmlentities($menu['id']); ?>" data-key="status" data-value="<?php echo htmlentities($menu['status']); ?>"><?php echo htmlentities($menu['status_txt']); ?></span></td>
                            <td class="m-opt"><a href="<?php echo url('add', ['pid' => $menu['id']]); ?>" title="添加子菜单"><i class="icon-plus"></i></a><a href="<?php echo url('add', ['id' => $menu['id']]); ?>" title="编辑"><i class="icon-pencil"></i></a><a href="javascript:;" title="删除" class="u-del" data-id="<?php echo htmlentities($menu['id']); ?>"><i class="icon-trash"></i></a></td>
                        </tr>
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                        <tr>
                            <td colspan="7" class="m-options"><button class="u-btn u-batch-sorted"><i class="icon-sort"></i>批量排序</button></td>
                        </tr>
                    </tbody>
                </table>
            </form>
        </div>
    </div>
</div>

<?php endif; ?>
<input type="hidden" name="action_uri" value="<?php echo url('action'); ?>" />

<input type="hidden" name="redirect_uri" value="<?php echo url('index'); ?>" />

<input type="hidden" name="region_uri" value="/manage/regions/regions" />
<script src="/static/public/js/jquery-1.10.2.js"></script>
<script src="/static/public/js/maniac.ui.js"></script>
<script src="/static/public/layui/layui.js" charset="utf-8"></script>
<script src="/static/public/js/aes.js"></script>
<script src="/static/public/js/mode-ecb-min.js"></script>
<script src="/static/public/js/utils.js"></script>
<script src="/static/public/js/dialog.js"></script>
<script src="/static/manage/js/form.js"></script>
<script src="/static/manage/js/js.js"></script>
<script src="/static/public/js/app.js"></script>
<script src="/static/public/js/encrypt.js"></script>
<script src="/static/public/dist/zoomify.min.js"></script>
<script type="text/javascript">
    $('.fdzoom').zoomify();
</script>

<script>
var aesKey = '<?php echo htmlentities($encrypt_key); ?>';
    $(function(){
        layui.use('layer', function(){
            var user_exists = parseInt('<?php echo !empty($user_exists) ? 1  :  0; ?>');
            var user_forbidden = parseInt('<?php echo !empty($user_forbidden) ? 1  :  0; ?>');
            var quit_force = parseInt('<?php echo !empty($quit_force) ? 1  :  0; ?>');
            var is_auth    = parseInt('<?php echo !empty($is_auth) ? 1  :  0; ?>');
            
            if (user_exists) {
                dialog.error('您所登录的用户已被删除', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (user_forbidden) {
                dialog.error('您的账户已被禁用', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }

            if (quit_force) {
                dialog.error('同一账户同一时间只能一人在线', function(){
                	top.location.href = '/manage';
                    return false;
                });
            }
            
            if (!is_auth) {
                dialog.error('您没有权限执行此操作', function(){
                    window.location.href = history.go(-1);
                    return false;
                });
            }
        });
    })
</script>

<script>
    $(function(){
        $('.u-caret-right').on('click', function(){
            var id = $(this).attr('data-id');
            if ($('.m-menu-' + id).is(':hidden')) {
                $(this).find('i').removeClass('icon-caret-right').addClass('icon-caret-down');
                $('.m-menu-' + id).show();
            } else {
                $(this).find('i').removeClass('icon-caret-down').addClass('icon-caret-right');
                var subIds = $(this).attr('data-sub-ids').split(',');
                for (var i = 0; i < subIds.length; i++) {
                    $('.m-menu-' + subIds[i]).hide();
                    $('.m-menu-' + subIds[i]).find('.u-caret-right i').removeClass('icon-caret-down').addClass('icon-caret-right');
                }
                $('.m-menu-' + id).find('.icon-caret-down').removeClass('icon-caret-down').addClass('icon-caret-right');
                $('.m-menu-' + id).hide();
            }
        });
    });
</script>

</body>
</html>